#include "SymptomUnit.h"


SymptomUnit::SymptomUnit(SymptomGroup* parent,const QString& name,int row)
{
	this->parent = parent;
	this->name = name;
	this->row = row;
	this->_buildWidgets();
}

void SymptomUnit::_buildWidgets()
{
	this->_addLabel();
	this->_addRadioButtons();
	this->_addTextArea();
}

void SymptomUnit::_addLabel()
{
	this->label = new QLabel(this->name);
	this->label->setObjectName(QString("%1Label").arg(this->name));
	parent->getLayout()->addWidget(label,this->row,0);
}

void SymptomUnit::_addRadioButtons()
{
	this->noRadio = new QRadioButton("No");
	this->noRadio->setObjectName(QString("%1NoRadioButton").arg(this->name));
	parent->getLayout()->addWidget(noRadio,this->row,1);

	this->yesRadio = new QRadioButton("Yes");
	this->yesRadio->setObjectName(QString("%1YesRadioButton").arg(this->name));
	parent->getLayout()->addWidget(yesRadio,this->row,2);
}

void SymptomUnit::_addTextArea()
{
	this->area = new QTextEdit();
	this->area->setObjectName(QString("%1TextEdit").arg(this->name));
	parent->getLayout()->addWidget(area,this->row,3);
}

SymptomUnit::~SymptomUnit(void)
{
}
